# -*- cperl -*-
{
    #pop @result;
    my @r;
    do { push @r, $_ if (!m/^smart:.+$/) } for @result;
    my $expect = <<'____END_EXPECT';
start
end
echo "foobar: b.txt" > b.txt
ok
1..1
echo "foobar: a.txt <- b.txt" > a.txt
ok
====================
start
end
====================
start
end
echo "foobar: b.txt" > b.txt
ok
1..1
echo "foobar: a.txt <- b.txt" > a.txt
ok
====================
start
end
====================
start
end
1..1
echo "foobar: a.txt <- b.txt" > a.txt
ok
====================
start
end
====================
____END_EXPECT
    ;
    my $result = join '', @r; #@result;
    $check_result = $result eq $expect;
    $_ = "$file.log";
    unlink if -f;
    #print $result;
    #print $expect;
    do {
        open F, ">$file.log" or die "$!";
        print F "==================== expecting ==\n";
        print F $expect;
        print F "\n";
        print F "==================== received ===\n";
        print F $result;
        close F;
    } unless $check_result;
    print "";
}
